package com.gwt.boot.model;

import com.mybatisflex.core.paginate.Page;

import java.util.Collections;
import java.util.List;


/**
 * 分页结果
 * @param <T>
 */
public class PageEntity<T> extends Page<T> {

    public PageEntity(){

    }

    protected List<T> records = Collections.emptyList();

    public PageEntity(long current, long size){
        this.setPageNumber(current);
        this.setPageSize(size);
    }

    /**
     * 总数
     */
    protected long total = 0;

    /**
     * 每页显示条数，默认 10
     */
    protected long size = 10;

    /**
     * 当前页
     */
    protected long current = 1;

    public long getTotal() {
        return this.getTotalRow();
    }

    public long getSize() {
        return this.getPageSize();
    }

    public long getCurrent() {
        return this.getPageNumber();
    }
}
